<?php

class table_content_article extends table
{
	public $id = 0;
	public $category_id = 0;
	public $title = '';
	public $meta_keywords = '';
	public $meta_description = '';
	public $summary = '';
	public $body = '';
	public $home = 0;
	public $create_time = 0;
	public $create_by_id = 0;
	public $modify_time = 0;
	public $modify_by_id = 0;
	public $hits = 0;
	public $block = 0;
	public $ordering = 0;

	public function __construct()
	{
		parent::__construct( 'bone_content_article', 'id');
	}
	
	public function load_home()
	{
		return $this->load_by('home', 1);
	}

	public function hit()
	{
		$db = bone::get_db();
		$db->execute('UPDATE `bone_content_article` SET `hits`=`hits`+1 WHERE `id`='.$this->id);
	}
}